package com.tdkj.service.shop;

import java.math.BigDecimal;
import java.util.List;

import com.tdkj.model.shop.BeanOrder;
import com.tdkj.model.shop.BeanOrderConsigneeInfo;
import com.tdkj.model.shop.BeanOrderItem;
import com.tdkj.service.IBaseService;

public interface IBeanOrderService extends IBaseService {
	
	class Constant {
		public static final int STATE_INITED = 0;
		public static final int STATE_TO_PAY = 1;
		
		//客户与店主
		public static final int STATE_PAID = 2;
		public static final int STATE_TO_DELIVERY = 2;
		
		public static final int STATE_DELIVERYED = 3;
		public static final int STATE_TO_RECEIVE = 3;
		
		public static final int STATE_RECEIVED = 4;
		public static final int STATE_SUCCEED = 4;
		
		public static final int STATE_CANCELED = -1;
	}

	List<BeanOrderItem> getOrderItemsOfBuyer(Long userId);
	
	List<BeanOrder> getOrdersOfBuyer(Long userId);
	
	List<BeanOrder> getOrdersOfBuyer(Long userId, Integer state);
	
	List<BeanOrder> getOrdersOfSeller(Long userId);
	
	List<BeanOrder> getOrdersOfSeller(Long userId, Integer state);
	
	List<BeanOrder> create(Long buyerId, BeanOrderConsigneeInfo info);
	
	List<BeanOrder> create(Long auctionId, Long buyerId, BeanOrderConsigneeInfo info, Integer logisticsApproach, BigDecimal logisticsPrice);
	
	//STATE_TO_PAY -> STATE_TO_DELIVERY
	void createPay(Long buyerId, Long orderId);
	
	//STATE_TO_DELIVERY -> STATE_TO_RECEIVE
	void createDelivery(Long sellerId, Long orderId);
	
	//STATE_TO_RECEIVE -> STATE_SUCCEED
	void createReceive(Long buyerId, Long orderId);
	
	//STATE_TO_RECEIVE -> STATE_CANCELED
	void createCancel(Long buyerId, Long orderId);
}
